﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NineMine.Core
{
    public class AccessControl
    {        
        private readonly List<Permission> permissions;

        public AccessControl()
        {
            permissions = new List<Permission>();
        }

        private Mapper map;
        public Mapper Map()
        {
            throw new NotImplementedException();
        }

        public class Mapper
        {
            private readonly List<Permission> permissions;

            public Mapper()
            {
                permissions = new List<Permission>();
            }

            public void AddPermission(string name, bool @public, bool requireMember, bool requireLoggedIn, bool read)
            {
                permissions.Add(new Permission()
                {
                    Name = name,
                    Public = @public,
                    Read = read,
                    RequireLoggedIn = requireLoggedIn,
                    RequireMember = requireMember
                });
            }

            public List<Permission> MappedPermissions 
            {
                get { return permissions; }
            }
        }

        public class Permission
        {
            public string Name { get; set; }

            public bool Public { get; set; }

            public bool RequireMember { get; set; }

            public bool RequireLoggedIn { get; set; }

            public bool Read { get; set; }
        }
    }
}
